using Spread.Calculation.Properties;
using Spread.Common.Features.Sample;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Spread.Calculation.Features
{
    public partial class LAMBDAHelperFunction : BaseSampleControl
    {
        public LAMBDAHelperFunction()
        {
            InitializeComponent();
            fpSpread1.AsWorkbook().WorkbookSet.CalculationEngine.CalcFeatures |= GrapeCity.Spreadsheet.CalcFeatures.ReserveFormulaWhiteSpaces;
            fpSpread1.BorderCollapse = FarPoint.Win.Spread.BorderCollapse.Enhanced;
            using (MemoryStream s = new MemoryStream(Resources.lambda_function_examples))
            {
                fpSpread1.OpenExcel(s);
            }
            flag = false;
            splitContainer1.SplitterDistance = 21;
            fpSpread1.Focus();
        }

        private void nameManagerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            fpSpread1.ShowListCustomNameForm(this.ParentForm);
        }

        static bool flag = false;
        private void Form1_Resize(object sender, EventArgs e)
        {
            if (!flag)
            {
                flag = true;
                splitContainer1.SplitterDistance = 21;
            }
        }
    }
}


//
//LAMBDAHelperFunction.Designer.cs
//



namespace Spread.Calculation.Features
{
    partial class LAMBDAHelperFunction
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LAMBDAHelperFunction));
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.nameManagerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.splitContainer2 = new System.Windows.Forms.SplitContainer();
            this.nameBox1 = new FarPoint.Win.Spread.NameBox();
            this.fpSpread1 = new FarPoint.Win.Spread.FpSpread(FarPoint.Win.Spread.LegacyBehaviors.None, ((object)(resources.GetObject("splitContainer2.Panel1.Controls"))));
            this.fpSpread1_Sheet1 = this.fpSpread1.GetSheet(0);
            this.panel1 = new System.Windows.Forms.Panel();
            this.formulaTextBox1 = new FarPoint.Win.Spread.FormulaTextBox();
            this.menuStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
            this.splitContainer2.Panel1.SuspendLayout();
            this.splitContainer2.Panel2.SuspendLayout();
            this.splitContainer2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).BeginInit();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // menuStrip1
            // 
            this.menuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32);
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.nameManagerToolStripMenuItem});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Padding = new System.Windows.Forms.Padding(3, 1, 0, 1);
            this.menuStrip1.Size = new System.Drawing.Size(413, 24);
            this.menuStrip1.TabIndex = 1;
            this.menuStrip1.Text = "menuStrip1";
            // 
            // nameManagerToolStripMenuItem
            // 
            this.nameManagerToolStripMenuItem.Name = "nameManagerToolStripMenuItem";
            this.nameManagerToolStripMenuItem.Size = new System.Drawing.Size(101, 22);
            this.nameManagerToolStripMenuItem.Text = "Name Manager";
            this.nameManagerToolStripMenuItem.Click += new System.EventHandler(this.nameManagerToolStripMenuItem_Click);
            // 
            // splitContainer1
            // 
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 24);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
            this.splitContainer1.Panel1MinSize = 21;
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.Controls.Add(this.fpSpread1);
            this.splitContainer1.Size = new System.Drawing.Size(413, 247);
            this.splitContainer1.SplitterDistance = 24;
            this.splitContainer1.TabIndex = 2;
            // 
            // splitContainer2
            // 
            this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer2.Location = new System.Drawing.Point(0, 0);
            this.splitContainer2.Name = "splitContainer2";
            // 
            // splitContainer2.Panel1
            // 
            this.splitContainer2.Panel1.Controls.Add(this.nameBox1);
            // 
            // splitContainer2.Panel2
            // 
            this.splitContainer2.Panel2.Controls.Add(this.panel1);
            this.splitContainer2.Size = new System.Drawing.Size(413, 24);
            this.splitContainer2.SplitterDistance = 137;
            this.splitContainer2.TabIndex = 0;
            // 
            // nameBox1
            // 
            this.nameBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.nameBox1.Location = new System.Drawing.Point(0, 0);
            this.nameBox1.MaxLength = 255;
            this.nameBox1.Name = "nameBox1";
            this.nameBox1.Size = new System.Drawing.Size(137, 21);
            this.nameBox1.TabIndex = 0;
            // Attach nameBox1 to fpSpread1
            this.nameBox1.Attach(this.fpSpread1);
            // 
            // fpSpread1
            // 
            this.fpSpread1.AccessibleDescription = "Book1, Sheet1, Row 0, Column 0";
            this.fpSpread1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.fpSpread1.Font = new System.Drawing.Font("Calibri", 11F);
            this.fpSpread1.Location = new System.Drawing.Point(0, 0);
            this.fpSpread1.Name = "fpSpread1";
            this.fpSpread1.Size = new System.Drawing.Size(413, 219);
            this.fpSpread1.TabIndex = 0;
            // 
            // panel1
            // 
            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.panel1.Controls.Add(this.formulaTextBox1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(272, 24);
            this.panel1.TabIndex = 0;
            // 
            // formulaTextBox1
            // 
            this.formulaTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.formulaTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.formulaTextBox1.Location = new System.Drawing.Point(0, 0);
            this.formulaTextBox1.Name = "formulaTextBox1";
            this.formulaTextBox1.Size = new System.Drawing.Size(270, 22);
            this.formulaTextBox1.TabIndex = 0;
            // Attach formulaTextBox1 to fpSpread1
            this.formulaTextBox1.Attach(this.fpSpread1);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(413, 271);
            this.pnlMain.Controls.Add(this.splitContainer1);
            this.Controls.Add(this.menuStrip1);
            this.Margin = new System.Windows.Forms.Padding(2);
            this.Name = "LAMBDA Helper Functions";
            this.Text = "Spread.NET LAMBDA Function Examples";
            this.Resize += new System.EventHandler(this.Form1_Resize);
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.splitContainer2.Panel1.ResumeLayout(false);
            this.splitContainer2.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
            this.splitContainer2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.fpSpread1)).EndInit();
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.ToolStripMenuItem nameManagerToolStripMenuItem;
        private System.Windows.Forms.SplitContainer splitContainer1;
        private System.Windows.Forms.SplitContainer splitContainer2;
        private FarPoint.Win.Spread.NameBox nameBox1;
        private FarPoint.Win.Spread.FpSpread fpSpread1;
        private System.Windows.Forms.Panel panel1;
        private FarPoint.Win.Spread.FormulaTextBox formulaTextBox1;
        private FarPoint.Win.Spread.SheetView fpSpread1_Sheet1;
    }
}
